<?php
namespace app\index\model;

use think\Model;
use traits\model\SoftDelete;

class Data extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $autoWriteTimestamp = true;
    protected $auto = [];
    protected $insert = ['ip','status' => 1];
    protected $update = ['login_ip'];
    public  function  getStatusAttr($value)
    {
        if ($value ==1) {
        	return '男';
        }elseif ($value ==2) {
        	return '女';
        }else{
        	return '未知';
        }
    }
    public  function  setIpAttr($value)
    {
          return request()->ip();
    }
    public function setContentAttr($value)
    {
        return md5($value);
    }
}